import GameConfig from '../../Server/Data/GameConfig';
import { StarType } from '../../Server/Data/GameConfig';
import PromptManage from '../PromptManage';
import SoundUtil from '../../Fantasy/Util/SoundUtil';


const {ccclass, property} = cc._decorator;

@ccclass
export default class StarCard extends cc.Component {

    @property(cc.Sprite)
    starpng: cc.Sprite = null;

    @property(cc.Node)
    blackPng: cc.Node = null;

    starCardName = '';
    /**
     * 
     * @param starName 
     * @param level  1,2,3,4
     * @param isLock 
     */
    setStarCard(starName:StarType,level,isLock){
        let addres = 'Texture/星座卡片正面/';
        this.starCardName = '';
        switch(level){
            case 1:
                this.starCardName += '石器_';
                break;
            case 2:
                this.starCardName += '青铜_';
                break;
            case 3:
                this.starCardName += '白银_';
                break;
            case 4:
                this.starCardName += '黄金_';
                break;
        }
        let name = GameConfig.getStarChinese(starName);
        this.starCardName += name;
        Log("名字：",addres + this.starCardName)
        LoadResImg(this.starpng,addres + this.starCardName);

        this.blackPng.active = isLock;
    }

    btnCallback(target,data){
        PromptManage.addStarCardExplain(this.starCardName);
    }
}
